import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
// 引入路由模式组件
// 在ts 中使用react-router-dom 路由模块时,需要下载它的模块的一个类型声明文件, 否则提示找不到数据类型
// npm i --save-dev @types/react-router-dom
// 但是有的模块内自带类型声明文件,所有直接可以在ts 引入使用
import { BrowserRouter as Router } from 'react-router-dom';

// 入口文件中挂载store 
import store from './store/Index'
import { Provider } from 'react-redux'

const root = ReactDOM.createRoot(
  document.getElementById('root') as HTMLElement
);


root.render(
  <Provider store={store}>
    <Router>
      <App />
    </Router>
  </Provider>

);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
